#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void reverse(int* arr, int sz, int k)
{
	int * brr = (int *)malloc(sz);
	int len = sz / sizeof(int);
	memmove(brr, arr + len - k , k*(sizeof(int)));
	memmove(brr + k, arr, sz - k * (sizeof(int)));
	memmove(arr, brr, sz);
	free(brr);
	brr = NULL;
}

int main()
{
	int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
	int sz = sizeof(arr);
	int k = 3;
	reverse(arr, sz, k);
	for (int i = 0; i < sz / sizeof(int); i++)
	{
		printf("%d ", arr[i]);
	}
	return 0;
}